﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HOOMT
{
    public class Attribute
    {
        private String accessModifier;
        private String attributeType;
        private String attributeName;
        private String initialValue;
        private String description;
        public String id;
        //###################################################################################
        public Attribute(String accessModifier, String attributeType, String attributeName, String initialValue, String description = "")
        {
            this.accessModifier = accessModifier;
            this.attributeType = attributeType;
            this.attributeName = attributeName;
            this.initialValue = initialValue;
            this.description = description;
            this.id = System.Guid.NewGuid().ToString();
        }

        public Attribute(String accessModifier, String attributeType, String attributeName, String initialValue, String id, String description = "")
        {
            this.accessModifier = accessModifier;
            this.attributeType = attributeType;
            this.attributeName = attributeName;
            this.initialValue = initialValue;
            this.description = description;
            this.id = id;
        }


        //***********************************************************************************
        public String AccessModifier
        {
            get
            {
                return accessModifier;
            }
            set
            {
                accessModifier = value;
            }
        }
        public String AttributeType
        {
            get
            {
                return attributeType;
            }
            set
            {
                attributeType = value;
            }
        }
        public String AttributeName
        {
            get
            {
                return attributeName;
            }
            set
            {
                attributeName = value;
            }
        }
        public String InitialValue
        {
            get
            {
                return initialValue;
            }
            set
            {
                initialValue = value;
            }
        }
        public String Description
        {
            get
            {
                return description;
            }
            set
            {
                description = value;
            }
        }
        //***********************************************************************************
        public override string ToString()
        {
            return accessModifier + "  " + attributeType + "  " + attributeName + " = " + initialValue + ";" + "  " + description;
        }
        public String getShowString()
        {
            String showStr="";
            switch (accessModifier)
            {
                case "public":
                    showStr = "+";
                    break;
                case "private":
                    showStr = "-";
                    break;
                case "protected":
                    showStr="#";
                    break;
                default:
                    showStr="";
                    break;
            }
            return showStr + "  " + attributeType + "  " + attributeName;
        }
        //************************************************************************************

        
    }
}
